/*************************************************************************
	> File Name: P2840.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-01-13 18:23:10
 ************************************************************************/

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;

#define MAX_N 10000

int val[MAX_N + 5];
int dp[MAX_N + 5];
const int mod = 1e9 + 7;

int main() {
    int n, w;
    cin >> n >> w;
    for (int i = 1; i <= n; i++) {
        cin >> val[i];
    }
    dp[0] = 1;
    for (int i = 1; i <= w; i++) {
        for (int j = 1; j <= n; j++) {
            if (i - val[j] < 0) continue;
            dp[i] += dp[i - val[j]];
            dp[i] %= mod; 
        }
    }
    cout << dp[w] << endl;
    return 0;
}
